#!/usr/bin/env python
# -*- coding=utf-8 -*-
 
# @File    :   test.py
# @Version :   1.0
# @Author  :   xin
# @Time    :   2023/10/25 10:50:20
#Description:
# 删除文件的后面部分 

import os

if __name__ == "__main__":
    with open("/home/aoting/testhivsion/test_hikvision/pic/a11.jpg", mode="rb") as file :
         t=file.read()
    with open("/home/aoting/testhivsion/test_hikvision/pic/27_ISAPI_Pic_0.jpg", mode="rb") as file :
         t2=file.read()
    # with open("/home/aoting/testhivsion/test_hikvision/pic/a2.jpg", mode="wb") as file :
    #      file.write(t[:-25000])
    # with open("/home/aoting/testhivsion/test_hikvision/pic/a3.jpg", mode="wb") as file :
    #      file.write(t)
    #      file.write(t)
    with open("/home/aoting/testhivsion/test_hikvision/pic/a4.jpg", mode="wb") as file :
        size = os.path.getsize('/home/aoting/testhivsion/test_hikvision/pic/a11.jpg') 
        print(size)
        s=(int)(size/100)
        print(s)
        file.write(t[0:s])
        file.write(t2[s:])
    pass
